#ifndef _IM_SERVER_COMET_PUBLISH_REQUEST_
#define _IM_SERVER_COMET_PUBLISH_REQUEST_

#include "http_request.h"

namespace imserver {

class CometPublishRequest : public HttpRequest {
 public:
  CometPublishRequest(CometConnectionPtr conn, const std::string & data)
    : HttpRequest(conn, data) {
    ++ctor_count_;
  }
  virtual ~CometPublishRequest() {}

  virtual void OnWriteComplete();
  virtual int OnCheckTicketComplete(int64_t qid, const std::string & username);

  static int64_t ctor_count_;
  static int64_t in_200_;
  static int64_t in_retry_;
  static int64_t in_typing_;
  static int64_t in_400_;
  static int64_t in_401_;
 private:
  virtual bool Response();
};

}

#endif // _IM_SERVER_COMET_PUBLISH_REQUEST_
